{% extends 'trp/base.html'%}
{% block content %}
<!-- 广告位管理——管理员 -->
<input type="hidden" id="mediaId" value="{{mediaId}}"/>
<div class="pageheader">
    <a class="btn-create createposition" href="javascript:;"><span class="glyphicon glyphicon-plus"></span>新增广告位</a>
    <div class="searchbox pull-right">
        <label>搜索<input id="term" class="searchbox-ipt" placeholder="按名称、属性模糊搜索" type="text"></label>
        <a class="searchbox-btn" href="javascript:;"></a>
    </div>
    <div class="dropbox pull-right">
	    <input type="text" name="measure" style="width:150px;" placeholder="按尺寸搜索" />
    </div>
</div>
<div class="pagebox">
	<table id="positionList" class="grid" width="100%">
	    <thead>
	        <tr>
	            <th>广告位名称</th>
	            <th>广告位属性</th>
	            <th>宽</th>
	            <th>高</th>
	            <!-- <th>轮播数</th> -->
	            <th>素材类型</th>
	            <th>大小限制</th>
	            <th>分栏数</th>
	            <th>展示类型</th>
	            <th minwidth="150">操作</th>
	        </tr>
	    </thead>
	    <tbody>
	    	<tr><td colspan="9" class="loading">&nbsp;</td></tr>
	    </tbody>
	</table>
</div>
<div class=" pop-form form-group pop-createposition" style="display:none;">
	<form class="positionForm">
		<div class="form_item">
			<label class="form_label">广告位名称：</label>
			<div class="form_ctrl name">
				<input type="text" name="name" class="form-control required" maxlength="40" placeholder="请填写名称..." />
			</div>
		</div>
		<div class="form_item" style="height:auto;">
			<label class="form_label">广告位属性：</label>
			<div class="form_ctrl attrs">
				<select name="attrs" multiple style="width:235px;" placeholder="请选择属性..."></select>
				<a class="btn-create creatattr red" style="margin:0 0 0 5px;font-size:12px;" href="javascript:;" title="新增广告位属性"><span class="glyphicon glyphicon-plus"></span></a>
			</div>
		</div>
		<div class="form_item halfunit">
			<label class="form_label">尺寸：</label>
			<div class="form_ctrl width">
				<input type="text" name="width" class="form-control required digits" style="width:106px;display:inline-block;" placeholder="请填写宽度..." />
				&nbsp;x&nbsp;
				<input type="text" name="height" class="form-control required digits" style="width:106px;display:inline-block;" placeholder="请填写高度..." />
				&nbsp;像素&nbsp;(宽 x 高)
			</div>
		</div>
		<div class="form_item hasunit" style="height:auto;">
			<label class="form_label">素材类型：</label>
			<div class="form_ctrl types">
				<select name="types" multiple style="width:235px;" class="required" placeholder="请选择类型..."></select>
			</div>
		</div>
		<div class="form_item hasunit">
			<label class="form_label">大小限制：</label>
			<div class="form_ctrl size">
				<input type="text" name="size" class="form-control digits {min:1}" style="display:inline-block;" placeholder="请填写大小..." />
				&nbsp;KB
			</div>
		</div>
		<div class="form_item hasunit">
			<label class="form_label">分栏数：</label>
			<div class="form_ctrl size">
				<input type="text" name="max" class="form-control digits" style="display:inline-block;" value="1" placeholder="请填写分栏数..." />
			</div>
		</div>
		<div class="form_item showtype">
			<label class="form_label">展示类型：</label>
			<div class="form_ctrl">
				<div class="btn-group btn-group-sm">
					<button type="button" class="btn btn-default btn-success" showtype="0">默认</button>
					<button type="button" class="btn btn-default disabled" showtype="1">轮播图</button>
					<button type="button" class="btn btn-default disabled" showtype="2">Banner</button>
					<button type="button" class="btn btn-default" showtype="3">自定义模板</button>
				</div>
			</div>
		</div>
		<div class="form_item hasunit slidetime" style="display:none;">
			<label class="form_label">切换时间：</label>
			<div class="form_ctrl">
				<input type="text" name="time" class="form-control digits" style="display:inline-block;" value="3000" placeholder="请填写时间..." />
				&nbsp;毫秒
			</div>
		</div>
		<div class="form_item arraytype" style="display:none;">
			<label class="form_label">布局方式：</label>
			<div class="form_ctrl">
				<div class="btn-group btn-group-sm">
					<button type="button" class="btn btn-default btn-success" arraytype="0">水平布局</button>
					<button type="button" class="btn btn-default" arraytype="1">垂直布局</button>
				</div>
			</div>
		</div>
		<div class="form_item hasunit customtmpl" style="height:auto;display:none;">
			<label class="form_label">展示模板：</label>
			<div class="form_ctrl">
				<textarea type="text" name="customtmpl" class="form-control" placeholder="请填写模板..." style="float:left;width:420px;height:100px;margin:0 0 20px;line-height:20px;resize:vertical;"></textarea>
			</div>
		</div>
	</form>
</div>
<div class="pop-buytraffic pop-form form-group" style="display:none;">
	<form class="trafficForm">
		<div class="form_item">
			<label class="form_label">购买方式：</label>
			<div class="form_ctrl">
				<select name="bid_type" class="required" style="width:80px;" placeholder="请选择方式...">
					<option value="1" selected="selected">CPM</option>
					<option value="0">CPD</option>
				</select>
			</div>
		</div>
		<div class="form_item hasunit">
			<label class="form_label">购买周期：</label>
			<div class="form_ctrl">
				<div class="daterangebox">
			        <input type="text" name="circle" class="form-control daterangebox-ipt required" value="" style="width:234px" readonly  placeholder="请选择日期..." />
			        <a class="daterangebox-btn" href="javascript:;">日期</a>
			    </div>
			</div>
		</div>
		
		<div class="form_item hasunit">
			<label class="form_label">购买价格：</label>
			<div class="form_ctrl">
				<input type="text" name="bid_price" class="form-control number required" style="display:inline-block;" placeholder="请填写价格..."/>
				&nbsp;<span class="unit">元/CPM</span>
			</div>
		</div>        
		<div class="form_item">
			<label class="form_label">预估日千次曝光量：</label>
			<div class="form_ctrl">
				<input type="text" name="pv" class="form-control number" placeholder="请填写曝光数..."/>
			</div>
		</div>
		<div class="form_item">
			<label class="form_label">预估日点击量：</label>
			<div class="form_ctrl">
				<input type="text" name="click" class="form-control number" placeholder="请填写点击数..."/>
			</div>
		</div>
		<div class="form_item">
			<label class="form_label">是否平台独占：</label>
			<div class="form_ctrl">
				<input type="hidden" name="shared" />
				<div class="btn-group">
				  <button type="button" class="btn shared btn-success">是</button>
				  <button type="button" class="btn noshared btn-default">否</button>
				</div>
			</div>
		</div>
		<div class="shared_other" style="display:none;">
			<div class="form_item">
				<label class="form_label">售卖方式：</label>
				<div class="form_ctrl">
					<input type="text" name="buy_type" class="form-control" value="CPM" style="width:80px;float:left;" readonly placeholder="请选择方式..."/>
				</div>
			</div>
			<div class="form_item hasunit">
				<label class="form_label">底价：</label>
				<div class="form_ctrl">
					<input type="text" name="floor" class="form-control number" style="display:inline-block;" placeholder="请填写底价..."/>
					&nbsp;元/CPM
				</div>
			</div>
		</div>	
	</form>
</div>



<div class="pop-tf pop-form form-group" style="display:none;">
	<form class="tfForm">
		<div class="form_item">
			<label class="form_label">默认素材地址：</label>
			<div class="form_ctrl">
				<input type="text" name="src" class="form-control number" placeholder="请填素材地址..."/>
			</div>
		</div>
		<div class="form_item">
			<label class="form_label">默认跳转地址：</label>
			<div class="form_ctrl">
				<input type="text" name="ldp" class="form-control number" placeholder="请填写跳转地址..."/>
			</div>
		</div>
		<div class="form_item">
			<label class="form_label">默认超时时间：</label>
			<div class="form_ctrl">
				<input type="text" name="timeout" class="form-control number" value="1000" placeholder="请填写超时时间..."/>
			</div>
		</div>
		<div class="form_item">
			<label class="form_label">关键字：</label>
			<div class="form_ctrl">
				<input type="text" name="k1" class="form-control" placeholder="1级关键字" style="width:128px;display:inline-block;"/>&nbsp;-&nbsp;
				<input type="text" name="k2" class="form-control"  placeholder="2级关键字" style="width:128px;display:inline-block;"/>&nbsp;-&nbsp;
				<input type="text" name="k3" class="form-control" placeholder="3级关键字" style="width:128px;display:inline-block;"/>
			</div>
		</div>
		<div class="form_item" style="height:auto;">
			<label class="form_label">Iframe投放代码：</label>
			<div class="form_ctrl">
				<div class="frameCode">
					<textarea class="codecont"></textarea>
				</div>
			</div>
		</div>
		<div class="form_item" style="height:auto;">
			<label class="form_label">JavaScript投放代码：</label>
			<div class="form_ctrl">
				<div class="jsCode">
					<textarea class="codecont" readonly>
<script type="text/javascript">
	(function (doc) {
	    var js = doc.createElement('script'),
		fs = doc.getElementsByTagName('script')[0];
	    js.charset = 'utf-8';
	    js.src = '{serving}';
	    fs.parentNode.insertBefore(js, fs);
	})(document);
</script>

<div id="GOME_{pid}"></div>
<script type="text/javascript">
	(function(win) {
		var params = {};
	    params["_srv"] = 'GOME';
	    params["_id"] = 'GOME_{pid}';
	    
	    params["l"] = '{pid}';
	    params["w"] = '{width}';
	    params["h"] = '{height}';
	    
	    params["k1"] = '{k1}';
	    params["k2"] = '{k2}';
	    params["k3"] = '{k3}';
	    
	    params["max"] = '{max}';
	    params["showtype"] = '{showtype}';
	    params["time"] = '{time}';
	    params["arraytype"] = '{arraytype}';
	    params["code"] = '{code}';
	    
	    params["src"] = '{src}';
	    params["ldp"] = '{ldp}';
	    params["timeout"] = '{timeout}';
					
	    __semi_rpq = win.__semi_rpq || [];
	    __semi_rpq.push(params);
	})(window);
</script>
			        </textarea>
			        <a href="/static/trp/template/adserving_api.html" target="_blank" class="pull-right font12"><span class="glyphicon glyphicon-question-sign blue" style="vertical-align:middle;"></span>&nbsp;投放代码说明</a>
				</div>
			</div>
		</div>
	</form>
</div>

<div class=" pop-form form-group pop-createattr" style="display:none;">
	<form class="attrForm">
		<div class="form_item">
			<label class="form_label">广告位属性名称：</label>
			<div class="form_ctrl media_name"><input type="text" name="attr_name" class="form-control required" maxlength="40" placeholder="请填写名称..." /></div>
		</div>
	</form>
</div>
<script>seajs.use('trp/js/position');</script>
{% endblock %}